package com.todo.strategy.common.constant;

import com.todo.strategy.common.enums.PlanRelationSceneEnum;

/**
 * @author azhebuxing
 * @date 2025/2/27 00:55
 * @description
 */
public class StrategyOnlineKeyBuild {
    public static String strategyPlatformDetailKey(Long strategyId) {
        return String.format(StrategyOnlineRedisKey.STRATEGY_PLATFORM_DETAIL_INFO_KEY, strategyId);
    }

    public static String strategyPlatformExtendKey(Long strategyId) {
        return String.format(StrategyOnlineRedisKey.STRATEGY_DETAIL_EXTEND_KEY, strategyId);
    }

    public static String strategyUserInfoKey(Long strategyId) {
        return String.format(StrategyOnlineRedisKey.STRATEGY_USER_INFO_KEY, strategyId);
    }

    public static String strategyUserPlanRelation(Long userId, Long planId) {
        return String.format(StrategyOnlineRedisKey.STRATEGY_USER_PLAN_RELATION_KEY, userId, planId);
    }

    public static String planRelationListKey(PlanRelationSceneEnum businessScene, Long businessId) {
        return String.format(StrategyOnlineRedisKey.STRATEGY_PLAN_RELATION_LIST_KEY, businessScene, businessId);
    }

    public static String planSetDetailKey(Long planId) {
        return String.format(StrategyOnlineRedisKey.STRATEGY_PLAN_SET_DETAIL_KEY, planId);
    }

    public static String memoTemplateKey(Long memoTemplateId) {
        return String.format(StrategyOnlineRedisKey.MEMO_TEMPLATE_KEY, memoTemplateId);
    }

    public static String memoUserDetailKey(Long memoRelationId) {
        return String.format(StrategyOnlineRedisKey.MEMO_USER_DETAIL_KEY, memoRelationId);
    }

    public static String memoUserPlanRelationKey(Long user, Long planId) {
        return String.format(StrategyOnlineRedisKey.MEMO_USER_PLAN_KEY, user, planId);
    }

    public static String wantUserListKey(Long userId) {
        return String.format(StrategyOnlineRedisKey.WANT_USER_LIST_KEY, userId);
    }

    public static String wantRelationKey(Long wantId) {
        return String.format(StrategyOnlineRedisKey.WANT_SET_RELATION_KEY, wantId);
    }

    public static String UStrategyCounterIdempotentKey(String messageId) {
        return String.format(StrategyOnlineRedisKey.U_STRATEGY_COUNTER_IDEMPOTENT_KEY, messageId);
    }

    public static String PStrategyCounterIdempotentKey(String messageId) {
        return String.format(StrategyOnlineRedisKey.P_STRATEGY_COUNTER_IDEMPOTENT_KEY, messageId);
    }

    public static String strategyPlanContentRelationKey(Long userId, Long planId) {
        return String.format(StrategyOnlineRedisKey.PLAN_CONTENT_RELATION_KEY, userId, planId);
    }
}
